<template>
    <div :key="dealWithKey">
        <!--002001004 DQDFNAXONLILLLQIHE-->
        <dealWith001001 v-if="parameterData.sqsxbm == '002001001'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith001021 v-else-if="parameterData.sqsxbm == '002001021'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith001002 v-else-if="parameterData.sqsxbm == '002001002'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith001003 v-else-if="parameterData.sqsxbm == '002001003'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith001004 v-else-if="parameterData.sqsxbm == '002001004'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith002001 v-else-if="parameterData.sqsxbm == '002002001'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith002002 v-else-if="parameterData.sqsxbm == '002002002'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith002003 v-else-if="parameterData.sqsxbm == '002002003'" ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/> 
        <dealWith v-else ref="dealWithRef" :parameter="parameterData" @successReturn="successReturn" @updatedSuccess="updatedSuccess"/>
    </div>
</template>
<script>
import dealWith from './dealWith.vue'
import dealWith001001 from './dealWith-001001.vue'
import dealWith001021 from './dealWith-001021.vue'
import dealWith001002 from './dealWith-001002.vue'
import dealWith001003 from './dealWith-001003.vue'
import dealWith001004 from './dealWith-001004.vue'
import dealWith002001 from './dealWith-002001.vue'
import dealWith002002 from './dealWith-002002.vue'
import dealWith002003 from './dealWith-002003.vue'
import {getSqsxBm} from './service/index.js'
export default {
    components:{
        dealWith,
        dealWith001001,
        dealWith001021,
        dealWith001002,
        dealWith001003,
        dealWith001004,
        dealWith002001,
        dealWith002002,
        dealWith002003,
    },
    props:{

    },
    data(){
        return{
            parameterData:{},
            dealWithKey:null,
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        getDatas(val){
            this.$store.dispatch('UpdateSpinningPrice', {key:true,stateKey:'modalSpinningPrice'})
            getSqsxBm({sqsxid:val.sqsxid}).then(res=>{
                if(res.code == 200){
                    val['sqsxbm'] = res.result
                    //console.log('获取到什么啊！',val)
                    this.parameterData = val
                    this.dealWithKey = Date.now()
                    this.$nextTick(()=>{    
                        this.$store.dispatch('UpdateSpinningPrice', {key:true,stateKey:'modalSpinningPrice'})
                        this.$refs.dealWithRef.getDatas(val)
                    })
                }else{
                    this.$message.warning(res.message)
                }
            })
            
        },
        updatedSuccess(){
            this.$emit('updatedSuccess')
        },
        successReturn(val){
            this.$emit('successReturn',val)
        }
    }
}
</script>